-
Notifications
You must be signed in to change notification settings - Fork 12
Switch to CPack for packaging #379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Switch to CPack for packaging #379
Conversation
81c2641 to
4c2a4dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, the approach looks correct. Not knowing CPack, I'm not sure though.
MAINTENANCE.md
Outdated
| 11. Build binary packages with CPack on each target platform (Linux, macOS, Windows). The README provides the exact command sequence (`cmake -S`, `cmake --build`, `cpack -G <generator>`). If you do not have access to the platforms locally, trigger a run of the reusable workflow `.github/workflows/build-cpack-packages.yml` from another workflow and download the resulting artifacts. | ||
| 12. Go to https://github.com/scylladb/cpp-rust-driver/releases , click the `Draft new release` button and follow the procedure to create a new release on GitHub. Use the release notes as its description. | ||
| 13. After the release is published, the `Attach Packages to Release` workflow (`.github/workflows/release-upload-packages.yml`) automatically builds fresh packages using CPack and uploads every artifact to the release. Verify that the workflow finished successfully and that RPM/DEB/MSI/PKG/DMG files are attached. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ What is the intended difference between building packages in point 11 and 13?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, please take a look.
README.md
Outdated
| Debian packages set shlibdeps automatically; RPM packages target the | ||
| `Applications/Databases` group and use release number `1` by default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ What does it mean? It's all Greek to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated, please take a look
README.md
Outdated
| Both outputs bundle the compiled libraries alongside headers and pkg-config | ||
| manifests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ This also uses naming that is unknown to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated, please take a look
| workflow_call: | ||
| inputs: | ||
| build-type: | ||
| description: CMake build type used for packaging | ||
| type: string | ||
| default: Release | ||
| extra-cmake-flags: | ||
| description: Additional flags passed to CMake configure step | ||
| type: string | ||
| default: "" | ||
| save-artifacts: | ||
| description: Save built packages as artifacts | ||
| type: boolean | ||
| default: false | ||
| secrets: {} | ||
| workflow_dispatch: | ||
| inputs: | ||
| build-type: | ||
| description: CMake build type used for packaging | ||
| type: string | ||
| default: Release | ||
| extra-cmake-flags: | ||
| description: Additional flags passed to CMake configure step | ||
| type: string | ||
| default: "" | ||
| save-artifacts: | ||
| description: Save built packages as artifacts | ||
| type: boolean | ||
| default: false | ||
| secrets: {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 It's a pity we need to be that WET instead of DRY. Chat GPT, however, hasn't come up with a better solution for enabling both manual dispatch and being called from another workflow, both with the same parameters and configuration.
Makefile
Outdated
| SHELL = bash | ||
|
|
||
| SHELL = bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Why the duplication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just, copy-paste, fixed
Makefile
Outdated
| SHELL = bash | ||
| ifeq ($(OS),Windows_NT) | ||
| SHELL := pwsh.exe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔧 I believe it's an error to mix eager binding := operator with late binding operator = for the same variable. Do you agree?
| sudo dpkg -i "${DRIVER_PACKAGES[@]}" | ||
| sudo apt-get install -f -y | ||
| - name: Build smoke-test application package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ Let's add a missing (DEB and RPM) suffix, so this step's name isconsistency with other steps ((DEB) only) is explicit.
cd1ba37 to
53b56dc
Compare
e12fbe9 to
6e2fe62
Compare
bc27f0e to
30d8b6e
Compare
Remove legacy debian, redhat, and homebrew packaging scripts that are being replaced by CPack-based packaging. Removed: - dist/debian/ - deb build scripts and debian control files - dist/redhat/ - rpm spec and build scripts - dist/homebrew/ - homebrew formula
Add CPack configuration for cross-platform package generation: - DEB and RPM packages on Linux - productbuild and DragNDrop on macOS - WIX installer on Windows Configure component-based packaging with runtime and dev components. Add RunMacProductbuild.cmake helper for macOS package generation. Update scylla-rust-wrapper CMakeLists.txt with proper install targets and component assignments.
Add cross-platform packaging support to Makefile: - OS detection (linux/macos/windows) - build-driver, build-package, install-package targets - Dependency installation helpers for each platform - Normalize variable assignments for consistency Adds targets: - .package-build-prepare: install build dependencies - .package-configure: configure CMake with appropriate settings - build-driver: build the driver library - build-package: create platform-specific packages - install-package: install packages locally for testing
Add new GitHub Actions workflows for CPack-based packaging: - build-cpack-packages.yml: build packages on Linux, macOS, Windows - release-upload-packages.yml: upload artifacts on release Update existing workflows: - pkg.yml: simplify to use new CPack-based approach - build-lint-and-test.yml: use consistent make command
Add a standalone smoke test application to validate installed packages: - CMakeLists.txt: cross-platform build configuration - Makefile: convenient build and test targets - docker-compose.yml: ScyllaDB container for testing - src/smoke_test.c: simple connection test The smoke test verifies that installed packages work correctly by connecting to a ScyllaDB instance and performing basic operations.
Fix flaky integration tests: - test_heartbeat.cpp: adjust timing for more reliable heartbeat detection - test_dc_aware_policy.cpp: minor stability fix Refactor testing utilities: - testing.cpp/hpp: improve test helper functions - testing_rust_impls.h: update FFI declarations - cass_error.rs: adjust error handling for tests
Update README.md with new CPack-based packaging instructions. Update MAINTENANCE.md with revised release process using CPack.
- .gitignore: add packaging-related entries - cmake/FindOpenSSL.cmake: improve OpenSSL path detection - cmake/CMakeCargo.cmake: fix cargo build integration
Move .ONESHELL directive to global scope (was Windows-only) and remove
unnecessary "; \" line continuations and @{ } blocks now that all recipe
lines run in a single shell invocation.
Co-Authored-By: Claude Opus 4.5 <[email protected]>
fe07754 to
2fc7774
Compare
Pre-review checklist
Makefilein{SCYLLA,CASSANDRA}_(NO_VALGRIND_)TEST_FILTER.Fixes:annotations to PR description.